﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class TourVendor        
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name = string.Empty;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _nr = string.Empty;
        [DataMember]
        public string Nr
        {
            get { return _nr; }
            set { _nr = value; }
        }

        private string _address = string.Empty;
        [DataMember]
        public string Address
        {
            get { return _address; }
            set { _address = value; }
        }

        private string _contactPerson = string.Empty;
        [DataMember]
        public string ContactPerson
        {
            get { return _contactPerson; }
            set { _contactPerson = value; }
        }

        private string _area = string.Empty;
        [DataMember]
        public string Area
        {
            get { return _area; }
            set { _area = value; }
        }

        private List<Project> _projectList = new List<Project>();
        [DataMember]
        public List<Project> ProjectList
        {
            get { return _projectList; }
            set { _projectList = value; }
        }

        private string _type = string.Empty;
        [DataMember]
        public string Type
        {
            get { return _type; }
            set { _type = value; }
        }

        public string 类别 
        {
            get 
            {
                StringBuilder sb = new StringBuilder();
                foreach (Project project in ProjectList) 
                {
                    if (sb.ToString() != string.Empty)
                        sb.Append(",");
                    sb.Append(project.Name);
                }

                return sb.ToString();
            }
        }

        private string _remark = string.Empty;
        [DataMember]
        public string Remark
        {
            get { return _remark; }
            set { _remark = value; }
        }

        private bool _effective = true;
        [DataMember]
        public bool Effective
        {
            get { return _effective; }
            set { _effective = value; }
        }

        private string _contactPersonTel = string.Empty;
        [DataMember]
        public string ContactPersonTel
        {
            get { return _contactPersonTel; }
            set { _contactPersonTel = value; }
        }

        private List<Tour> _tourList = new List<Tour>();
        [DataMember]
        public List<Tour> TourList
        {
            get { return _tourList; }
            set { _tourList = value; }
        }

        private List<TourVendorAttachment> _attachmentList = new List<TourVendorAttachment>();
        [DataMember]
        public List<TourVendorAttachment> AttachmentList
        {
            get { return _attachmentList; }
            set { _attachmentList = value; }
        }
    }
}
